import { request } from '@/utils/request.js'

// 查询项目列表
export function getProjectList(query) {
  return request({
    url: 'cloud/project/index',
    method: 'get',
    params: query
  })
}

// 查询对话列表
export function getConversaionProject(query) {
  return request({
    url: 'client/conversaion/getList',
    method: 'get',
    params: query
  })
}


// 发送消息
export function sendMessage(query) {
  return request({
    url: 'client/message/manualMessage',
    method: 'post',
    data: query
  })
}
// 查询未读对话
export function getNumOfUnread(query) {
  return request({
    url: 'client/conversaion/getNumOfUnread',
    method: 'get',
    params: query
  })
}
// 清除未读短信数量
export function clearUnread(query) {
  return request({
    url: 'client/message/clearUnread',
    method: 'post',
    data: query
  })
}


// 查询管理员对话列表
export function getConversaionProjectAdmin(query) {
  return request({
    url: 'client/conversaion/getListByAdmin',
    method: 'get',
    params: query
  })
}
// 查询对话列表
export function getConversaionDetail(query) {
  return request({
    url: 'client/message/getList',
    method: 'get',
    params: query
  })
}
// 查询管理员对话列表
export function getConversaionDetailAdmin(query) {
  return request({
    url: 'client/message/getListByAdmin',
    method: 'get',
    params: query
  })
}
// 管理员发送消息
export function sendMessageAdmin(query) {
  return request({
    url: 'client/message/manualMessageByAdmin',
    method: 'post',
    data: query
  })
}
// 查询管理员未读对话
export function getNumOfUnreadAdmin(query) {
  return request({
    url: 'client/conversaion/getNumOfUnreadByAdmin',
    method: 'get',
    params: query
  })
}
// 清除管理员未读短信数量
export function clearUnreadAdmin(query) {
  return request({
    url: 'client/message/clearUnreadByAdmin',
    method: 'post',
    data: query
  })
}

// 添加对话
export function createConversaion(query) {
  return request({
    url: 'client/conversaion/create',
    method: 'post',
    data: query
  })
}
//获取客服开关/client/conversaion/getConfig
export function getConfig(query) {
  return request({
    url: 'client/conversaion/getConfig',
    method: 'get',
    data: query
  })
}